<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker,autocomplete"></t:base>
<div class="easyui-layout" fit="true">
    <div region="center" style="padding:0px;border:0px">
            <t:datagrid name="l0" pagination="false"  title=""  fitColumns="false"  onLoadSuccess="doload"  onClick="onselect" actionUrl="scsjxController.do?sublistDatagrid" idField="id" fit="true" >
           <t:dgCol title="id"  field="id"   hidden="true"    width="120"></t:dgCol>
            <t:dgCol title="表名"  field="fd_tb"    width="120"></t:dgCol>
            <t:dgCol title="tag名称"  field="fd_tag"    width="120"></t:dgCol>
            <t:dgCol title="说明"  field="fd_sm"    width="120"></t:dgCol>

            <t:dgCol title="操作" field="opt" width="60"></t:dgCol>
            <t:dgDelOpt title="删除" url="scsjxController.do?dodel&p=0&id={id}" urlclass="ace_button"  urlfont="fa-trash-o"/>

            <t:dgToolBar title="录入" icon="icon-add" url="scsjxController.do?edit&p=0" funname="add" width="770" height="500"></t:dgToolBar>
            <t:dgToolBar title="编辑" icon="icon-edit" url="scsjxController.do?edit&p=0" funname="update" width="770"></t:dgToolBar>
        </t:datagrid>
    </div>
</div>
<script type="text/javascript">
    function onselect(rowData) {       
        var selected = $('#l0').datagrid('getSelected');
       // window.parent.tableid = selected.id;
        window.parent.twotableid = selected.id;        

        /*
         window.parent.onetableid = selected.id;
         window.parent.rowIndex   = rowIndex;
         if(window.parent.pageSelected==0){
         window.parent.suber.location.replace("/fwq/scrwglController.do?twotitle&keyid="+window.parent.onetableid+"&pageno="+window.parent.pageSelected);
         };*/
    }
    function doload(rowData){
        var selected = $('#l0').datagrid('getSelected');
        if(selected) {
            var ntotlength = rowData.rows.length;
            if(ntotlength < 1) {
                window.parent.twotableid = "";
            }
        } else {
            var ntotlength = rowData.rows.length;
            if(ntotlength > 0) {
                $('#l0').datagrid('selectRow',0);
                var selected = $('#l0').datagrid('getSelected');
                window.parent.twotableid = selected.id;
            } else {

                window.parent.twotableid = "";

            }
        }
    }

</script>